#!/usr/bin/env python
#coding=utf-8
#author=xiaomayi0323
#date=2009/02/27
#filename=2-8a

#使用固定值和While循环实现计算五个数值的和
a = [1,2,3,4,5]
b = len(a)
c = 0
d = 0
while c < b:
    d = a[c] + d 
    c = c + 1
    
print d

#updata

a = [1,2,3,4,5]
c = 0
d = 0
while c < len(a):
    d = a[c] + d 
    c = c + 1
    
print d
